import request from "@/utils/request";
import { curCommunity } from "@/api/common";
import qs from "qs";
import { param } from "jquery";

let comApi = '/cgi-bin/entry.cgi'

// 人员列表
export function getPersonList(data) {
  return request({
    url: `${comApi}/event/person-info-list`,
    method: "post",
    data,
  });
}

// 人员添加/修改
export function addPerson(data) {
  return request({
    url: `${comApi}/event/person-info`,
    method: "post",
    data,
  });
}
// 添加设备
export function addDevice(data) {
  return request({
    url: `${comApi}/event/device-register-person`,
    method: "post",
    data,
  });
}
// 轮询人员
export function queryPersonIdByName(data) {
  return request({
    url: `${comApi}/event/get-personId-by-name`,
    method: "post",
    data,
  });
}
// 远程添加
export function handleRemoteAdd(data) {
  return request({
    url: `${comApi}/event/device-register-person`,
    method: "post",
    data,
  });
}

// 获得认证方式
export function getEventIdentity(data) {
  return request({
    url: `${comApi}/event/identity-list`,
    method: "post",
    data,
  });
}

// 认证方式添加/修改 人脸图片上传/IC卡上传
export function editEventIdentity(data) {
  return request({
    url: `${comApi}/event/identity`,
    method: "post",
    data,
  });
}

// 上传图片
export function fileUploadApi(data) {
  return request({
    url: `${comApi}/system/file-upload`,
    method: "post",
    data,
  });
}

// 上传 ic卡
export function uploadPersonFace(data) {
  return request({
    url: `${comApi}/event/identity`,
    method: "post",
    data,
  });
}

// 上传指纹
export function uploadPersonFinger(data) {
  return request({
    url: `${comApi}/event/identity_finger`,
    method: "post",
    data,
  });
}

// 全部删除 ic卡
export function deleteIcCardList(data) {
  return request({
    url: `${comApi}/event/idcard-delete`,
    method: "post",
    data,
  });
}

// 删除人脸图片
export function delPersonFaceApi(data) {
  return request({
    url: `${comApi}/event/identity-delete`,
    method: "post",
    data,
  });
}

// 删除上传图片
export function delUploadPicApi(data) {
  return request({
    url: `${comApi}/system/file-delete`,
    method: "post",
    data,
  });
}


